﻿using PetaPoco;
using PmSoft;
using PmSoft.Caching;
using System.ComponentModel;

namespace Modules.System.AppNotice
{
    /// <summary>
    /// APP通知公告
    ///</summary>
    [TableName("app_notice_info")]
    [Description("app通知公告")]
    [PrimaryKey("Id", AutoIncrement = true)]
    [CacheSetting(true)]
    [Serializable]
    public class AppNoticeInfo : IEntity
    {
        /// <summary>
        ///  主键Id
        ///</summary>
        [Column("id")]
        public int Id { get; set; }

        /// <summary>
        /// 公告类型  1=通知公告 2=升级提示
        ///</summary>
        [Column("notice_type")]
        public 通知公告类型 NoticeType { get; set; }

        /// <summary>
        /// 标题
        ///</summary>
        [Column("title")]
        public string Title { get; set; }

        /// <summary>
        /// 内容
        ///</summary>
        [Column("content")]
        public string Content { get; set; }

        /// <summary>
        /// 最低版本配置
        /// </summary>
        [Column("min_version")]
        public string? MinVersion { get; set; }

        /// <summary>
        /// 是否置顶 1=指定 0=不置顶
        /// 默认值: b'0'
        ///</summary>
        [Column("is_top")]
        public bool IsTop { get; set; } = false;

        /// <summary>
        /// 是否删除 0=未删除 1=已删除
        /// 默认值: b'0'
        ///</summary>
        [Column("is_deleted")]
        public bool IsDeleted { get; set; } = false;

        /// <summary>
        /// 创建时间
        ///</summary>
        [Column("create_time")]
        public DateTime CreateTime { get; set; } = DateTime.Now;

        /// <summary>
        ///
        ///</summary>
        [Column("update_time")]
        public DateTime? UpdateTime { get; set; } = DateTime.Now;

        #region IEntity 成员

        [Ignore]
        object IEntity.EntityId { get { return this.Id; } }

        #endregion IEntity 成员
    }
}